package clientApp;

import java.util.ArrayList;

import clientApp.utils.RPG_Workstation_Container;

import game.referenceValues.UnitClass;
import game.units.Attribute;
import game.units.Character;

/**
 *
 * @author Gabriel
 */
@SuppressWarnings("serial")
public class CharacterBuilder3 extends javax.swing.JPanel {

	RPG_Workstation_Container container;
	Character character;
	int ptsLeft;
	UnitClass lvlClass;
	boolean isNewChar = false;
	int fortitude;
	int reflex;
	int will;
	
    /** Creates new form CharacterBuilder3 */
    public CharacterBuilder3(RPG_Workstation_Container rpg_Workstation_Container, Character character, UnitClass lvlClass, boolean isNewChar) {
    	this.container = rpg_Workstation_Container; 
    	this.character = character;
    	this.lvlClass = lvlClass;
    	this.isNewChar = isNewChar;
        initComponents();
        initValues();
    }

    private void initValues() {
    	jLabel15.setVisible(false);
		jCBLevelBonusStats.setVisible(false);
		jBBonusSelect.setVisible(false);
		jBReset.setVisible(false);
		int strBonus = (character.getRace().getModifiers().get("Str")!=null)?character.getRace().getModifiers().get("Str") : 0;
    	int conBonus = (character.getRace().getModifiers().get("Con")!=null)?character.getRace().getModifiers().get("Con") : 0;
    	int dexBonus = (character.getRace().getModifiers().get("Dex")!=null)?character.getRace().getModifiers().get("Dex") : 0;
    	int intBonus = (character.getRace().getModifiers().get("Int")!=null)?character.getRace().getModifiers().get("Int") : 0;
    	int wisBonus = (character.getRace().getModifiers().get("Wis")!=null)?character.getRace().getModifiers().get("Wis") : 0;
    	int chaBonus = (character.getRace().getModifiers().get("Cha")!=null)?character.getRace().getModifiers().get("Cha") : 0;
		jTFStrRaceMod.setText(""+strBonus);
		jTFDexRaceMod.setText(""+dexBonus);
		jTFConsRaceMod.setText(""+conBonus);
		jTFIntRaceMod.setText(""+intBonus);
		jTFWisRaceMod.setText(""+wisBonus);
		jTFCharRaceMod.setText(""+chaBonus);
				
    	if(character.getLevel() == 1)
		{
    		jBReset.setVisible(true);
			jTFPointsLeft.setText(""+character.attributePointsLeft);
			ptsLeft = character.attributePointsLeft;
			jTFStrBase.setText(""+character.getAttributes().get(Attribute.STRENGTH).getValue());
			jTFDexBase.setText(""+character.getAttributes().get(Attribute.DEXTERITY).getValue());
			jTFConsBase.setText(""+character.getAttributes().get(Attribute.CONSTITUTION).getValue());
			jTFIntBase.setText(""+character.getAttributes().get(Attribute.INTELLIGENCE).getValue());
			jTFWisBase.setText(""+character.getAttributes().get(Attribute.WISDOM).getValue());
			jTFCharBase.setText(""+character.getAttributes().get(Attribute.CHARISMA).getValue());	
		}
    	else
    	{
    		jBChaMinus.setVisible(false);
    		jBChaPlus.setVisible(false);
    		jBConsMinus.setVisible(false);
    		jBConsPlus.setVisible(false);
    		jBDexMinus.setVisible(false);
    		jBDexPlus.setVisible(false);
    		jBIntMinus.setVisible(false);
    		jBIntPlus.setVisible(false);
    		jBStrMinus.setVisible(false);
    		jBStrPlus.setVisible(false);
    		jBWisMinus.setVisible(false);
    		jBWisPlus.setVisible(false);    		
    		
    		jTFStrBase.setText(""+character.getAttributes().get(Attribute.STRENGTH).getValue());
			jTFDexBase.setText(""+character.getAttributes().get(Attribute.DEXTERITY).getValue());
			jTFConsBase.setText(""+character.getAttributes().get(Attribute.CONSTITUTION).getValue());
			jTFIntBase.setText(""+character.getAttributes().get(Attribute.INTELLIGENCE).getValue());
			jTFWisBase.setText(""+character.getAttributes().get(Attribute.WISDOM).getValue());
			jTFCharBase.setText(""+character.getAttributes().get(Attribute.CHARISMA).getValue());
			
    	}
    	if(character.getLevel()%4 == 0)
    	{
    		jLabel15.setVisible(true);
    		jCBLevelBonusStats.setVisible(true);
    		jBBonusSelect.setVisible(true);
    	}    	
    	setModifiersText();
    	fortitude = (Integer.parseInt(jTFStrMod.getText())>=Integer.parseInt(jTFConsMod.getText())?Integer.parseInt(jTFStrMod.getText()):Integer.parseInt(jTFConsMod.getText()));
		reflex = (Integer.parseInt(jTFDexMod.getText())>=Integer.parseInt(jTFIntMod.getText())?Integer.parseInt(jTFDexMod.getText()):Integer.parseInt(jTFIntMod.getText()));
		will = (Integer.parseInt(jTFWisMod.getText())>=Integer.parseInt(jTFCharMod.getText())?Integer.parseInt(jTFWisMod.getText()):Integer.parseInt(jTFCharMod.getText()));
	}

	private void setModifiersText() 
	{
		jTFStrMod.setText(""+(Attribute.modifierValue(Integer.parseInt(jTFStrBase.getText()))));
		jTFConsMod.setText(""+(Attribute.modifierValue(Integer.parseInt(jTFConsBase.getText()))));
		jTFDexMod.setText(""+(Attribute.modifierValue(Integer.parseInt(jTFDexBase.getText()))));
		jTFIntMod.setText(""+(Attribute.modifierValue(Integer.parseInt(jTFIntBase.getText()))));
		jTFWisMod.setText(""+(Attribute.modifierValue(Integer.parseInt(jTFWisBase.getText()))));
		jTFCharMod.setText(""+(Attribute.modifierValue(Integer.parseInt(jTFCharBase.getText()))));
		
		
	}

    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jBStrPlus = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jBStrMinus = new javax.swing.JButton();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jTFStrMod = new javax.swing.JTextField();
        jTFStrBase = new javax.swing.JTextField();
        jBConsPlus = new javax.swing.JButton();
        jTFConsBase = new javax.swing.JTextField();
        jBConsMinus = new javax.swing.JButton();
        jTFConsMod = new javax.swing.JTextField();
        jBDexPlus = new javax.swing.JButton();
        jTFDexBase = new javax.swing.JTextField();
        jBDexMinus = new javax.swing.JButton();
        jTFDexMod = new javax.swing.JTextField();
        jBIntPlus = new javax.swing.JButton();
        jTFIntBase = new javax.swing.JTextField();
        jBIntMinus = new javax.swing.JButton();
        jTFIntMod = new javax.swing.JTextField();
        jBWisPlus = new javax.swing.JButton();
        jTFWisBase = new javax.swing.JTextField();
        jBWisMinus = new javax.swing.JButton();
        jTFWisMod = new javax.swing.JTextField();
        jTFCharMod = new javax.swing.JTextField();
        jBChaMinus = new javax.swing.JButton();
        jTFCharBase = new javax.swing.JTextField();
        jBChaPlus = new javax.swing.JButton();
        jLabel12 = new javax.swing.JLabel();
        jTFPointsLeft = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        jTFStrRaceMod = new javax.swing.JTextField();
        jTFConsRaceMod = new javax.swing.JTextField();
        jTFDexRaceMod = new javax.swing.JTextField();
        jTFIntRaceMod = new javax.swing.JTextField();
        jTFWisRaceMod = new javax.swing.JTextField();
        jTFCharRaceMod = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        jBReset = new javax.swing.JButton();
        JBNext = new javax.swing.JButton();
        jBBack = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTextArea1 = new javax.swing.JTextArea();
        jSeparator1 = new javax.swing.JSeparator();
        jSeparator2 = new javax.swing.JSeparator();
        jLabel15 = new javax.swing.JLabel();
        jCBLevelBonusStats = new javax.swing.JComboBox();
        jBBonusSelect = new javax.swing.JButton();

        jPanel1.setBackground(new java.awt.Color(0, 0, 102));
        jPanel1.setPreferredSize(new java.awt.Dimension(780, 568));

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 28));
        jLabel1.setForeground(new java.awt.Color(255, 255, 255));
        jLabel1.setText("Character Ablility Score");

        jBStrPlus.setText("+");
        jBStrPlus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBStrPlusActionPerformed(evt);
            }
        });

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel2.setForeground(new java.awt.Color(255, 255, 255));
        jLabel2.setText("Base Score");

        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel3.setForeground(new java.awt.Color(255, 255, 255));
        jLabel3.setText("Strength");

        jBStrMinus.setText("-");
        jBStrMinus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBStrMinusActionPerformed(evt);
            }
        });

        jLabel5.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel5.setForeground(new java.awt.Color(255, 255, 255));
        jLabel5.setText("Constitution");

        jLabel6.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel6.setForeground(new java.awt.Color(255, 255, 255));
        jLabel6.setText("Modifier");

        jLabel7.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel7.setForeground(new java.awt.Color(255, 255, 255));
        jLabel7.setText("Dexterity");

        jLabel8.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel8.setForeground(new java.awt.Color(255, 255, 255));
        jLabel8.setText("Intelligence");

        jLabel9.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel9.setForeground(new java.awt.Color(255, 255, 255));
        jLabel9.setText("Wisdom");

        jLabel10.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel10.setForeground(new java.awt.Color(255, 255, 255));
        jLabel10.setText("Charisma");

        jTFStrMod.setEditable(false);

        jTFStrBase.setEditable(false);

        jBConsPlus.setText("+");
        jBConsPlus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBConsPlusActionPerformed(evt);
            }
        });

        jTFConsBase.setEditable(false);

        jBConsMinus.setText("-");
        jBConsMinus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBConsMinusActionPerformed(evt);
            }
        });

        jTFConsMod.setEditable(false);

        jBDexPlus.setText("+");
        jBDexPlus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBDexPlusActionPerformed(evt);
            }
        });

        jTFDexBase.setEditable(false);

        jBDexMinus.setText("-");
        jBDexMinus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBDexMinusActionPerformed(evt);
            }
        });

        jTFDexMod.setEditable(false);

        jBIntPlus.setText("+");
        jBIntPlus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBIntPlusActionPerformed(evt);
            }
        });

        jTFIntBase.setEditable(false);

        jBIntMinus.setText("-");
        jBIntMinus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBIntMinusActionPerformed(evt);
            }
        });

        jTFIntMod.setEditable(false);

        jBWisPlus.setText("+");
        jBWisPlus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBWisPlusActionPerformed(evt);
            }
        });

        jTFWisBase.setEditable(false);

        jBWisMinus.setText("-");
        jBWisMinus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBWisMinusActionPerformed(evt);
            }
        });

        jTFWisMod.setEditable(false);

        jTFCharMod.setEditable(false);

        jBChaMinus.setText("-");
        jBChaMinus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBChaMinusActionPerformed(evt);
            }
        });

        jTFCharBase.setEditable(false);

        jBChaPlus.setText("+");
        jBChaPlus.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBChaPlusActionPerformed(evt);
            }
        });

        jLabel12.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel12.setForeground(new java.awt.Color(255, 255, 255));
        jLabel12.setText("Points Left");

        jTFPointsLeft.setEditable(false);

        jLabel13.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel13.setForeground(new java.awt.Color(255, 255, 255));
        jLabel13.setText("Race Modifier");

        jTFStrRaceMod.setEditable(false);

        jTFConsRaceMod.setEditable(false);

        jTFDexRaceMod.setEditable(false);

        jTFIntRaceMod.setEditable(false);

        jTFWisRaceMod.setEditable(false);

        jTFCharRaceMod.setEditable(false);

        jLabel14.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel14.setForeground(new java.awt.Color(255, 255, 255));
        jLabel14.setText("Reset Points");

        jBReset.setText("Reset");
        jBReset.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBResetActionPerformed(evt);
            }
        });

        JBNext.setText("Next");
        JBNext.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JBNextActionPerformed(evt);
            }
        });

        jBBack.setText("Back");
        jBBack.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBBackActionPerformed(evt);
            }
        });

        jTextArea1.setColumns(20);
        jTextArea1.setEditable(false);
        jTextArea1.setFont(new java.awt.Font("Tahoma", 0, 12));
        jTextArea1.setRows(5);
        jTextArea1.setText("Current Score:\tCost to Raise:\n   6 - 14\t\t   1 point\n   15 - 16\t\t   2 points\n   17 - 18\t\t   3 points");
        jScrollPane1.setViewportView(jTextArea1);

        jLabel15.setFont(new java.awt.Font("Tahoma", 0, 12));
        jLabel15.setForeground(new java.awt.Color(255, 255, 255));
        jLabel15.setText("Level Up Bonus:");

        jCBLevelBonusStats.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Strength", "Constitution", "Dexterity", "Intelligence", "Wisdom", "Charisma" }));

        jBBonusSelect.setText("Select");
        jBBonusSelect.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBBonusSelectActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel10)
                    .addComponent(jLabel8)
                    .addComponent(jLabel7)
                    .addComponent(jLabel9)
                    .addComponent(jLabel5)
                    .addComponent(jLabel3))
                .addGap(23, 23, 23)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jBStrPlus)
                    .addComponent(jBConsPlus)
                    .addComponent(jBDexPlus)
                    .addComponent(jBIntPlus)
                    .addComponent(jBWisPlus)
                    .addComponent(jBChaPlus))
                .addGap(6, 6, 6)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jTFCharBase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTFWisBase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTFIntBase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTFDexBase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTFConsBase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTFStrBase, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jBWisMinus)
                    .addComponent(jBChaMinus)
                    .addComponent(jBIntMinus)
                    .addComponent(jBDexMinus)
                    .addComponent(jBConsMinus)
                    .addComponent(jBStrMinus))
                .addGap(84, 84, 84)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jLabel6)
                    .addComponent(jTFStrMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTFConsMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTFDexMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTFIntMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTFWisMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTFCharMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(42, 42, 42)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTFStrRaceMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel13)
                    .addComponent(jTFConsRaceMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTFDexRaceMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTFIntRaceMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTFWisRaceMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTFCharRaceMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(390, Short.MAX_VALUE)
                .addComponent(jBBack, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(JBNext, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(10, 10, 10))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel12)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jTFPointsLeft, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel14)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jBReset)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jCBLevelBonusStats, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jBBonusSelect))
                    .addComponent(jLabel15))
                .addContainerGap(63, Short.MAX_VALUE))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 242, Short.MAX_VALUE)
                .addContainerGap(10, Short.MAX_VALUE))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jSeparator2, javax.swing.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE)
                .addContainerGap(10, Short.MAX_VALUE))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(538, 538, 538)
                .addComponent(jLabel11)
                .addContainerGap(14, Short.MAX_VALUE))
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jTFCharBase, jTFCharMod, jTFCharRaceMod, jTFConsBase, jTFConsMod, jTFConsRaceMod, jTFDexBase, jTFDexMod, jTFDexRaceMod, jTFIntBase, jTFIntMod, jTFIntRaceMod, jTFPointsLeft, jTFStrBase, jTFStrMod, jTFStrRaceMod, jTFWisBase, jTFWisMod, jTFWisRaceMod});

        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel1)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel11)
                            .addComponent(jLabel6)
                            .addComponent(jLabel13))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTFStrRaceMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(2, 2, 2))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jBStrPlus)
                                .addComponent(jLabel3)
                                .addComponent(jTFStrBase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jTFStrMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jBStrMinus)))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jBConsPlus)
                        .addComponent(jLabel5)
                        .addComponent(jTFConsBase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jTFConsMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jTFConsRaceMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jBConsMinus)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jBDexPlus)
                        .addComponent(jLabel7)
                        .addComponent(jTFDexBase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jTFDexMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jTFDexRaceMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jBDexMinus)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel9, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jBWisPlus, javax.swing.GroupLayout.Alignment.TRAILING))
                        .addGap(11, 11, 11)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel10, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jBChaPlus, javax.swing.GroupLayout.Alignment.TRAILING)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTFIntBase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTFIntMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTFIntRaceMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jBIntMinus)
                            .addComponent(jBIntPlus))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTFWisBase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jBWisMinus)
                            .addComponent(jTFWisMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTFWisRaceMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(11, 11, 11)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTFCharBase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jBChaMinus)
                            .addComponent(jTFCharMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTFCharRaceMod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(jTFPointsLeft, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14)
                    .addComponent(jBReset))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel15)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jCBLevelBonusStats, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jBBonusSelect))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 23, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JBNext)
                    .addComponent(jBBack))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 552, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 490, Short.MAX_VALUE)
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jBStrPlusActionPerformed(java.awt.event.ActionEvent evt) {                                          
    	int cost = Attribute.upgradeCost(Integer.parseInt(jTFStrBase.getText()));
    	if (ptsLeft - cost >= 0)
    	{
    		ptsLeft = ptsLeft - cost;
    		jTFPointsLeft.setText(""+ptsLeft);
    		jTFStrBase.setText(""+(Integer.parseInt(jTFStrBase.getText())+1));
    		jTFStrMod.setText("" +Attribute.modifierValue(Integer.parseInt(jTFStrBase.getText())));
    	}
    	setModifiersText();
    }

    private void jBStrMinusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBStrMinusActionPerformed
    	int cost = Attribute.upgradeCost(Integer.parseInt(jTFStrBase.getText())-1);
    	if ((Integer.parseInt(jTFStrBase.getText())-1) >= 6)
    	{
    		ptsLeft = ptsLeft + cost;
    		jTFPointsLeft.setText(""+ptsLeft);
    		jTFStrBase.setText(""+(Integer.parseInt(jTFStrBase.getText())-1));
    		jTFStrMod.setText("" +Attribute.modifierValue(Integer.parseInt(jTFStrBase.getText())));
    	}
    	setModifiersText();	
    }

    private void jBConsMinusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBConsMinusActionPerformed
    	int cost = Attribute.upgradeCost(Integer.parseInt(jTFConsBase.getText())-1);
    	if ((Integer.parseInt(jTFConsBase.getText())-1) >= 6)
    	{
    		ptsLeft = ptsLeft + cost;
    		jTFPointsLeft.setText(""+ptsLeft);
    		jTFConsBase.setText(""+(Integer.parseInt(jTFConsBase.getText())-1));
    		jTFConsMod.setText("" +Attribute.modifierValue(Integer.parseInt(jTFConsBase.getText())));
    	}
    	setModifiersText();	
    }

    private void jBDexMinusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBDexMinusActionPerformed
    	int cost = Attribute.upgradeCost(Integer.parseInt(jTFStrBase.getText())-1);
    	if ((Integer.parseInt(jTFDexBase.getText())-1) >= 6)
    	{
    		ptsLeft = ptsLeft + cost;
    		jTFPointsLeft.setText(""+ptsLeft);
    		jTFDexBase.setText(""+(Integer.parseInt(jTFDexBase.getText())-1));
    		jTFDexMod.setText("" +Attribute.modifierValue(Integer.parseInt(jTFDexBase.getText())));
    	}
    	setModifiersText();	
    }

    private void jBIntMinusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBIntMinusActionPerformed
    	int cost = Attribute.upgradeCost(Integer.parseInt(jTFIntBase.getText())-1);
    	if ((Integer.parseInt(jTFIntBase.getText())-1) >= 6)
    	{
    		ptsLeft = ptsLeft + cost;
    		jTFPointsLeft.setText(""+ptsLeft);
    		jTFIntBase.setText(""+(Integer.parseInt(jTFIntBase.getText())-1));
    		jTFIntMod.setText("" +Attribute.modifierValue(Integer.parseInt(jTFIntBase.getText())));
    	}
    	setModifiersText();	
    }

     private void jBWisMinusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBWisMinusActionPerformed
    	 int cost = Attribute.upgradeCost(Integer.parseInt(jTFWisBase.getText())-1);
     	if ((Integer.parseInt(jTFWisBase.getText())-1) >= 6)
     	{
     		ptsLeft = ptsLeft + cost;
     		jTFPointsLeft.setText(""+ptsLeft);
     		jTFWisBase.setText(""+(Integer.parseInt(jTFWisBase.getText())-1));
     		jTFWisMod.setText("" +Attribute.modifierValue(Integer.parseInt(jTFWisBase.getText())));
     	}
     	setModifiersText();	
     }

     private void jBChaMinusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBChaMinusActionPerformed
    	 int cost = Attribute.upgradeCost(Integer.parseInt(jTFCharBase.getText())-1);
     	if ((Integer.parseInt(jTFCharBase.getText())-1) >= 6)
     	{
     		ptsLeft = ptsLeft + cost;
     		jTFPointsLeft.setText(""+ptsLeft);
     		jTFCharBase.setText(""+(Integer.parseInt(jTFCharBase.getText())-1));
     		jTFCharMod.setText("" +Attribute.modifierValue(Integer.parseInt(jTFCharBase.getText())));
     	}
     	setModifiersText();	
     }

     private void JBNextActionPerformed(java.awt.event.ActionEvent evt) {                                       
    	 character.setAttributes(generateAttributes());
    	 character.attributePointsLeft = ptsLeft;
    	 int fort = (Integer.parseInt(jTFStrMod.getText())>=Integer.parseInt(jTFConsMod.getText())?Integer.parseInt(jTFStrMod.getText()):Integer.parseInt(jTFConsMod.getText()));
    	 int re = (Integer.parseInt(jTFDexMod.getText())>=Integer.parseInt(jTFIntMod.getText())?Integer.parseInt(jTFDexMod.getText()):Integer.parseInt(jTFIntMod.getText()));
    	 int tempWill = (Integer.parseInt(jTFWisMod.getText())>=Integer.parseInt(jTFCharMod.getText())?Integer.parseInt(jTFWisMod.getText()):Integer.parseInt(jTFCharMod.getText()));
    	 
    	 if(character.hasNewClass)
    	 {        		
    		 int points = (lvlClass.getInitSkillPts() + character.getAttributes().get(Attribute.INTELLIGENCE).getModifier()) * 4;    		 
    		 character.setSkillPointsLefts(character.getSkillPointsLefts()+points);
    		 character.hasNewClass = false;
    	 }
    	 if(isNewChar)
    	 {
    		 
    		 character.setLifePoints(character.getLifePoints()+lvlClass.hpPerLevel+Integer.parseInt(jTFConsMod.getText()));
    		 int points = (lvlClass.getInitSkillPts() + character.getAttributes().get(Attribute.INTELLIGENCE).getModifier() + character.bonusSkillPoints) * 4;
    		 character.setSkillPointsLefts(points);
    		 character.hasNewClass = false;
    	 }
    	 character.setFortitude(character.getFortitude() + fort - fortitude);
    	 character.setReflex(character.getReflex() + re - reflex);
    	 character.setWill(character.getWill() + tempWill - will);
    	 character.setArmorClassValue();
    	 container.add(new CharacterBuilder4(container, character, lvlClass, isNewChar), "CharacterBuilder4");
         container.panels.show(container, "CharacterBuilder4");
     }

     private void jBBackActionPerformed(java.awt.event.ActionEvent evt) { 
    	 character.setAttributes(generateAttributes());
    	 character.attributePointsLeft = ptsLeft;
    	 container.add(new CharacterBuilder2(container, character, lvlClass, isNewChar), "CharacterBuilder2");
         container.panels.show(container, "CharacterBuilder2");
     }

    private void jBConsPlusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBConsPlusActionPerformed
    	int cost = Attribute.upgradeCost(Integer.parseInt(jTFConsBase.getText()));
    	if (ptsLeft - cost >= 0)
    	{
    		ptsLeft = ptsLeft - cost;
    		jTFPointsLeft.setText(""+ptsLeft);
    		jTFConsBase.setText(""+(Integer.parseInt(jTFConsBase.getText())+1));
    		jTFConsMod.setText("" +Attribute.modifierValue(Integer.parseInt(jTFConsBase.getText())));
    	}
    	setModifiersText();
    }//GEN-LAST:event_jBConsPlusActionPerformed

    private void jBDexPlusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBDexPlusActionPerformed
    	int cost = Attribute.upgradeCost(Integer.parseInt(jTFDexBase.getText()));
    	if (ptsLeft - cost >= 0)
    	{
    		ptsLeft = ptsLeft - cost;
    		jTFPointsLeft.setText(""+ptsLeft);
    		jTFDexBase.setText(""+(Integer.parseInt(jTFDexBase.getText())+1));
    		jTFDexMod.setText("" +Attribute.modifierValue(Integer.parseInt(jTFDexBase.getText())));
    	}
    	setModifiersText();
    }//GEN-LAST:event_jBDexPlusActionPerformed

    private void jBIntPlusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBIntPlusActionPerformed
    	int cost = Attribute.upgradeCost(Integer.parseInt(jTFIntBase.getText()));
    	if (ptsLeft - cost >= 0)
    	{
    		ptsLeft = ptsLeft - cost;
    		jTFPointsLeft.setText(""+ptsLeft);
    		jTFIntBase.setText(""+(Integer.parseInt(jTFIntBase.getText())+1));
    		jTFIntMod.setText("" +Attribute.modifierValue(Integer.parseInt(jTFIntBase.getText())));
    	}
    	setModifiersText();
    }//GEN-LAST:event_jBIntPlusActionPerformed

    private void jBWisPlusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBWisPlusActionPerformed
    	int cost = Attribute.upgradeCost(Integer.parseInt(jTFWisBase.getText()));
    	if (ptsLeft - cost >= 0)
    	{
    		ptsLeft = ptsLeft - cost;
    		jTFPointsLeft.setText(""+ptsLeft);
    		jTFWisBase.setText(""+(Integer.parseInt(jTFWisBase.getText())+1));
    		jTFWisMod.setText("" +Attribute.modifierValue(Integer.parseInt(jTFWisBase.getText())));
    	}
    	setModifiersText();
    }//GEN-LAST:event_jBWisPlusActionPerformed

    private void jBChaPlusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBChaPlusActionPerformed
    	int cost = Attribute.upgradeCost(Integer.parseInt(jTFCharBase.getText()));
    	if (ptsLeft - cost >= 0)
    	{
    		ptsLeft = ptsLeft - cost;
    		jTFPointsLeft.setText(""+ptsLeft);
    		jTFCharBase.setText(""+(Integer.parseInt(jTFCharBase.getText())+1));
    		jTFCharMod.setText("" +Attribute.modifierValue(Integer.parseInt(jTFCharBase.getText())));
    	}
    	setModifiersText();
    }//GEN-LAST:event_jBChaPlusActionPerformed

    private void jBResetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBResetActionPerformed
    	character.attributePointsLeft = 32;
    	initValues();
    	
    }//GEN-LAST:event_jBResetActionPerformed

    private void jBBonusSelectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBBonusSelectActionPerformed
        switch (jCBLevelBonusStats.getSelectedIndex()) {
		case 0:
			jTFStrBase.setText(""+(Integer.parseInt(jTFStrBase.getText())+1));
			setModifiersText();
			break;
		case 1:
			jTFConsBase.setText(""+(Integer.parseInt(jTFConsBase.getText())+1));
			setModifiersText();
			break;
		case 2:
			jTFDexBase.setText(""+(Integer.parseInt(jTFDexBase.getText())+1));
			setModifiersText();
			break;
		case 3:
			jTFIntBase.setText(""+(Integer.parseInt(jTFIntBase.getText())+1));
			setModifiersText();
			break;
		case 4:
			jTFWisBase.setText(""+(Integer.parseInt(jTFWisBase.getText())+1));
			setModifiersText();
			break;
		case 5:
			jTFCharBase.setText(""+(Integer.parseInt(jTFCharBase.getText())+1));
			setModifiersText();
			break;
		default:
			break;
		}
    }//GEN-LAST:event_jBBonusSelectActionPerformed

        
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton JBNext;
    private javax.swing.JButton jBBack;
    private javax.swing.JButton jBBonusSelect;
    private javax.swing.JButton jBChaMinus;
    private javax.swing.JButton jBChaPlus;
    private javax.swing.JButton jBConsMinus;
    private javax.swing.JButton jBConsPlus;
    private javax.swing.JButton jBDexMinus;
    private javax.swing.JButton jBDexPlus;
    private javax.swing.JButton jBIntMinus;
    private javax.swing.JButton jBIntPlus;
    private javax.swing.JButton jBReset;
    private javax.swing.JButton jBStrMinus;
    private javax.swing.JButton jBStrPlus;
    private javax.swing.JButton jBWisMinus;
    private javax.swing.JButton jBWisPlus;
    private javax.swing.JComboBox jCBLevelBonusStats;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JTextField jTFCharBase;
    private javax.swing.JTextField jTFCharMod;
    private javax.swing.JTextField jTFCharRaceMod;
    private javax.swing.JTextField jTFConsBase;
    private javax.swing.JTextField jTFConsMod;
    private javax.swing.JTextField jTFConsRaceMod;
    private javax.swing.JTextField jTFDexBase;
    private javax.swing.JTextField jTFDexMod;
    private javax.swing.JTextField jTFDexRaceMod;
    private javax.swing.JTextField jTFIntBase;
    private javax.swing.JTextField jTFIntMod;
    private javax.swing.JTextField jTFIntRaceMod;
    private javax.swing.JTextField jTFPointsLeft;
    private javax.swing.JTextField jTFStrBase;
    private javax.swing.JTextField jTFStrMod;
    private javax.swing.JTextField jTFStrRaceMod;
    private javax.swing.JTextField jTFWisBase;
    private javax.swing.JTextField jTFWisMod;
    private javax.swing.JTextField jTFWisRaceMod;
    private javax.swing.JTextArea jTextArea1;
    // End of variables declaration//GEN-END:variables
    
    private ArrayList<Attribute> generateAttributes()
    {
    	ArrayList<Attribute> atts = new ArrayList<Attribute>();
    	
    	Attribute str = new Attribute("Strength");
    	str.setValue(Integer.parseInt(jTFStrBase.getText()));
    	str.setModifier(Integer.parseInt(jTFStrMod.getText()));
    	atts.add(str);
    	
    	Attribute cons = new Attribute("Constitution");
    	cons.setValue(Integer.parseInt(jTFConsBase.getText()));
    	cons.setModifier(Integer.parseInt(jTFConsMod.getText()));
    	atts.add(cons);
    	
    	Attribute dex = new Attribute("Dexterity");
    	dex.setValue(Integer.parseInt(jTFDexBase.getText()));
    	dex.setModifier(Integer.parseInt(jTFDexMod.getText()));
    	atts.add(dex);
    	
    	Attribute inte = new Attribute("Intelligence");
    	inte.setValue(Integer.parseInt(jTFIntBase.getText()));
    	inte.setModifier(Integer.parseInt(jTFIntMod.getText()));
    	atts.add(inte);
    	
    	Attribute wis = new Attribute("Wisdom");
    	wis.setValue(Integer.parseInt(jTFWisBase.getText()));
    	wis.setModifier(Integer.parseInt(jTFWisMod.getText()));
    	atts.add(wis);
    	
    	Attribute chari = new Attribute("Charisma");
    	chari.setValue(Integer.parseInt(jTFCharBase.getText()));
    	chari.setModifier(Integer.parseInt(jTFCharMod.getText()));
    	atts.add(chari);
    	
		return atts;    	
    }
}
